def simplify(x,root=''):
    d = []
    if isinstance(x,str): return [('name',x)]
    for k,v in x.items():
        if root:
            root = root+'.'+k
        else:
            root = k        
        if isinstance(v,list):
            for item in v:
                if isinstance(item,dict):
                    if 'name' in item and len(item)==2:
                        value = [value for key,value in item.items() if not key=='name'][0]
                        d.append((root+'.'+item['name'], value))
                    else:
                        d += simplify(item,root)
                else:
                    d.append((root, str(v)))
                    break
            #d.update(simplify(dict(item)),root))        
        elif not isinstance(v,dict):
            d.append((root,str(v)))
        else:
            d += simplify(v,root)
    return d
    
